/*
* @Author: smallcatX0
* @Date:   2017-12-01 15:17:42
* @Last Modified by:   smallcatX0
* @Last Modified time: 2017-12-01 15:57:09
*/

#include <stdio.h>
#include <malloc.h>
int str_len(char s[]){
    int i=0;
    while(s[i]!='\0') i++;
    return i;
}
char* add_str(char a[],char b[]){
    int i = 0,j = 0;
    int len = str_len(a)+str_len(b);
    char* res = (char*)malloc(sizeof(char)*(len+1));
    while(a[i] != '\0') res[j++] = a[i++];
    i=0;
    while(b[i] != '\0') res[j++] = b[i++];
    res[len] = '\0';
    return res;
}

int main() {
    char a[]="1234123";
    char b[]="56789";
    char * res = add_str(a,b);
    printf("%s\n",res);
    return 0;
}